import {legacy_createStore,combineReducers,applyMiddleware,compose} from "redux"
import thunk from 'redux-thunk'
import NumStore from './NumStore/reducer.ts'
import ArrStore from './ArrStore/reducer.ts'

const reducers = combineReducers({
    NumStore,
    ArrStore
})

// 使用 redux-devtools
const composeEnhancers =
  typeof window === "object" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
    ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({})
    : compose;

// 使用 redux-thunk 中间件
const enhancer = composeEnhancers(applyMiddleware(thunk));    

const store = legacy_createStore(reducers,enhancer)

export default store